<%@page import="java.util.Calendar"%>
<%@page import="java.sql.Date"%>
<%@page import="entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body bgcolor = "#CCEEFF">
<%
User user = (User) session.getAttribute("User");
if(user == null){
%>
<center>
<h1>欢迎来到集美大学学生交流论坛</h1>
</center>
<center>
<b>当前是游客身份</b><br><br><br>
<button onclick = "window.top.location.href = 'login.jsp'"  >登陆</button>
<button onclick = "window.top.location.href = 'resigter.jsp'"  >注册</button>
<input type = "submit" value = "搜索"  onclick = "window.top.location.href = 'search.jsp'" >
</center>
<%
}
else 
{
%>
<center>
<%out.print("你好"+((User) session.getAttribute("User")).getUserName()); %>
<input type = "submit" value = "发帖" onclick = "window.top.location.href = 'write.jsp'">
<input type = "submit" value = "退出" onclick = 'window.top.location.href("ExitServlet")'><input type = "text" name = "search" >
<input type = "submit" value = "搜索" onclick = "window.top.location.href = 'search.jsp'">
</center>
<%
}
%>
</body>
</html>